package com.boe.csb.web.converter;

import org.apache.commons.lang3.time.DateFormatUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.convert.converter.Converter;

import java.util.Date;

/**
 * Date: 2014/12/15 15:39
 *
 * @author tianjin.lp <a href="mailto:liupengjava@gmail.com">Ricoul</a>
 */
public class DateToStringConverter implements Converter<Date, String> {

    private static final Logger LOGGER = LoggerFactory.getLogger(DateToStringConverter.class);

    @Override
    public String convert(Date date) {
        return DateFormatUtils.format(date, String.valueOf(DateFormatUtils.ISO_DATETIME_FORMAT));
    }
}